<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<table class="t_css" width="100%" border="0" cellpadding="0"
	id="basicInfo" cellspacing="1">
	<tr>
		<td colspan="4" class="t_bar">&nbsp;项目基本信息（金额单位：万元）</td>
	</tr>
	<tr>
		<td nowrap width="20%" align="right"><span class="color_red">*</span>项目名称：</td>
		<td nowrap colspan="3" width="80%"><input id="zh_title"
			name="proposal/zh_title" label="项目名称" type="text"
			class="input_css required maxlength:50" style="width: 75%;"
			maxlength="50"
			value="<x:out select="$xmlData/data/proposal/zh_title" />" /></td>
	</tr>
	<tr>
		<td nowrap align="right" width="20%"><span class="color_red">*</span>申报日期：</td>
		<td nowrap colspan="3"><c:set var="submit_date">
				<x:out select="$xmlData/data/proposal/submit_date" />
			</c:set> <cpt:date id="submit_date" name="proposal/submit_date"
				value="${submit_date}" className="required date" label="申报日期"></cpt:date>&nbsp;
		</td>
	</tr>
	<tr>
		<td  align="right" width="20%" nowrap><span class="color_red">*</span>申请资助金额：</td>
		<td  width="35%"><input name="proposal/total_funds" type="text"
			label="申请资助金额" id="total_funds" class="input_css required"
			onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/proposal/total_funds" />" /></td>
		<td  align="right" width="15%" nowrap><span class="color_red">*</span>项目已得市政府资助金额：</td>
		<td  width="35%"><input name="proposal/total_invest"
			id="total_invest" label="项目已得市政府资助金额" type="text" class="input_css required"
			onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/proposal/total_invest" />" /></td>
	</tr>
	<security:authorize ifAnyGranted="A_DAILU_PROPOSAL">
	<tr>
		<td nowrap width="20%" align="right"><span class="color_red">*</span>项目建设地点：</td>
		<td nowrap width="35%"><span name="proposal/site_address_area">具体地址:深圳</span>
		<input name="proposal/site_address" style="width:70%" label="项目建设地点" type="text" class="input_css required maxlength:50" maxlength="50" value="<x:out select="$xmlData/data/proposal/site_address" />" />
		</td>
		<td align="right" width="15%">项目负责人：</td>
		<td width="30%">
		<input type="text" disabled="disabled" name="proposal/responsible_name" label="项目负责人"  class="input_css required maxlength:100" value="<x:out select="$xmlData/data/proposal/responsible_name"/>" maxlength="100"/>
		<input type='hidden' name='responsible_name' value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" />" />
	
		<security:authorize ifAnyGranted="A_DAILU_PROPOSAL">
				<span id="personSelect">
				<input type="button" class="button_02" style="height: 25px; padding: 1px;" id="selectPsn" value="更改">
				<cpt:personSelect key="personSelect" addRole="3" callback="selectPsnCall" bindEvent="click" bindObject="selectPsn" title="设置项目负责人" fltFile="personSelector.ftl"></cpt:personSelect>
				</span>
		</security:authorize>
		</td>
	</tr>
	<tr>
		<td align="right" width="20%">电话：</td>
		<td width="35%">
		<input type='text' name='proposal/responsible_tel' class='required' maxlength='50' label='电话' value="<x:out select="$xmlData/data/proposal/responsible_tel"/>"/>
	    <input type='hidden' name='responsible_tel' value='<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work" />' />
		</td>
		<td align="right" width="15%">手机：</td>
		<td width="30%">
		<input type='text' name='proposal/responsible_mobile' class='required mobile' maxlength='11' onfocus="InitInput.setNumber(this,11,0,0)" label='手机' value="<x:out select="$xmlData/data/proposal/responsible_mobile"/>" />
	    <input type='hidden' name='responsible_mobile' value='<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" />' />
		</td>
	</tr>
	</security:authorize>
	<security:authorize ifNotGranted="A_DAILU_PROPOSAL">
		<tr>
		<td nowrap width="20%" align="right"><span class="color_red">*</span>项目建设地点：</td>
		<td nowrap width="35%"><span name="proposal/site_address_area">具体地址:深圳</span>
		<input name="proposal/site_address" style="width:70%" label="项目建设地点" type="text" class="input_css required maxlength:50" maxlength="50" value="<x:out select="$xmlData/data/proposal/site_address" />" />
		</td>
		<td align="right" width="15%">项目负责人：</td>
		<td width="30%">
		<span name="proposal/responsible_name"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" /></span>
		</td>
	</tr>
	<tr>
		<td align="right" width="20%">电话：</td>
		<td width="35%">
		<span name="proposal/responsible_tel"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work" /></span>
		</td>
		<td align="right" width="15%">手机：</td>
		<td width="30%">
		<span name="proposal/responsible_mobile"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" /></span>
		</td>
	</tr>
	</security:authorize>
	
	<tr>
        <td align="right"><span class="color_red">*</span>项目列入国家省市计划情况：</td>
		<td colspan='5' >
			<label style="margin-right:28px;">
			<input type="checkbox" name="chk_characteristic1" value="01" label="国家重大投资项目" class="do">&nbsp;&nbsp;国家重大投资项目</label>
			<label style="margin-right:30px;">
			<input type="checkbox" name="chk_characteristic1" value="02" label="省重大投资项目  " class="do">省重大投资项目 </label>
			<label>
			<input type="checkbox" name="chk_characteristic1" value="03" label="市重大投资项目" class="do">市重大投资项目 </label>
			<label style="margin-right:40px;">
			<input type="checkbox" name="chk_characteristic1" value="04" label="市技改备案项目 " class="do">市技改备案项目</label>
			<label>
			<input type="checkbox" name="chk_characteristic1" value="05" label="其它 " class="do">其它 </label>
			
			<input type="hidden" name="proposal/chk_characteristic1_value" label="项目列入国家省市计划情况" class="required" value="<x:out select="$xmlData/data/proposal/chk_characteristic1_value" />" />
			<input type="hidden" name="proposal/chk_characteristic1_name"  value="<x:out select="$xmlData/data/proposal/chk_characteristic1_name" />" />
		</td>
    </tr>
    
    <tr>
    	<td align="center" rowspan="2"><span class="color_red">*</span>项目自主知识产权或核心技术：</td>
    	<td align="center">发明专利（个）</td>
    	<td align="center" colspan="2">实用新型（个）</td>
    </tr>
    <tr>
    	<td  align="center"><input name="proposal/fmzl" type="text" label="发明专利" id="proposal/fmzl"
			class="input_css required "    onfocus="InitInput.setNumber(this,7,0,0)" maxlength="7"
			style="text-align: right;"
			value="<x:out select="$xmlData/data/proposal/fmzl" />" /></td>
    	<td  colspan="2"  align="center"><input name="proposal/syxx" type="text" label="实用新型" id="proposal/syxx"
			class="input_css required "    
			style="text-align: right;" onfocus="InitInput.setNumber(this,7,0,0)" maxlength="7"
			value="<x:out select="$xmlData/data/proposal/syxx" />" /></td>
    </tr>
    
    
	<tr>
		<td nowrap width="15%" align="right"><span class="color_red">*</span>项目投产情况：</td>
		<td nowrap colspan="3"><c:set var="production_situation_vlaue">
				<x:out select="$xmlData/data/proposal/production_situation_vlaue" />
			</c:set><input name="production_situation" id="situation1" type="radio"
			<c:if test="${production_situation_vlaue==1}"> checked="checked" </c:if>
			value="1" onclick="productionSituation(this)" />已投产 <input
			name="production_situation" id="situation2" type="radio"
			<c:if test="${production_situation_vlaue==2}"> checked="checked" </c:if>
			value="2" onclick="productionSituation(this)" />在建 
			<input id="production_situation_vlaue" type="hidden" class="required"  label="项目投产情况" name="proposal/production_situation_vlaue" value="<x:out select="$xmlData/data/proposal/production_situation_vlaue" />" />
			<input id="production_situation_name" type="hidden" name="proposal/production_situation_name" value="<x:out select="$xmlData/data/proposal/production_situation_name" />" />
		</td>
	</tr>
	<tr id="production_situation">
	    <td id="production_situation_1" style="display: none" align="right" width="15%"><span class="color_red">*</span>始建时间：</td>
		<td id="production_situation_2" style="display: none" width="35%">
		<c:set var="production_situation_start_date"><x:out select="$xmlData/data/proposal/production_situation_start_date" /></c:set>
		<cpt:date id="production_situation_start_date"  name="proposal/production_situation_start_date" value="${production_situation_start_date}" className=" date" label="始建时间"></cpt:date></td>
		<td id="production_situation_3" style="display: none" align="right" width="15%"><span class="color_red">*</span>投产时间：</td>
		<td id="production_situation_4" style="display: none" width="35%">
		<c:set var="production_situation_end_date"> <x:out select="$xmlData/data/proposal/production_situation_end_date" /></c:set>
		<cpt:date id="production_situation_end_date"  name="proposal/production_situation_end_date" value="${production_situation_end_date}" className=" date" label="投产时间"></cpt:date></td>
		<td id="production_situation_5" style="display: none" align="right" width="15%"><span class="color_red">*</span>计划投产时间：</td>
		<td id="production_situation_6" style="display: none" width="35%">
		<c:set var="production_situation_plan_date"><x:out select="$xmlData/data/proposal/production_situation_plan_date" /></c:set> 
		<cpt:date id="production_situation_plan_date"  name="proposal/production_situation_plan_date" value="${production_situation_plan_date}" className=" date" label="计划投产时间"></cpt:date></td>
	</tr>
	
	<tr>
		<td colspan="4" class="t_bar">&nbsp;<span class="color_red">*</span>项目投资情况（金额单位：万元）
		</td>
	</tr>
	<tr>
		<td nowrap align="right" width="15%">总投资：</td>
		<td width="35%"><input name="proposal/budget1" type="text" label="总投资" id="budget1"
			class="input_css gray" disabled onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/proposal/budget1" />" /></td>
		<td nowrap align="right" width="15%">项目用汇：</td>
		<td width="35%"><input name="proposal/budget2" label="项目投资情况->项目用汇" type="text"
			class="input_css required" onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/proposal/budget2" />" />万美元</td>
	</tr>
	<tr>
		<td nowrap align="right" width="15%">固定资产投资：</td>
		<td width="35%"><input name="proposal/budget3" type="text" label="固定资产投资" id="budget3"
			class="input_css gray" disabled  onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right;"
			value="<x:out select="$xmlData/data/proposal/budget3" />" /></td>
		<td nowrap align="right" width="15%">铺底流动资金：</td>
		<td width="35%"><input name="proposal/budget4" label="项目投资情况->铺底流动资金" type="text"
			class="input_css required" onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/proposal/budget4" />" /></td>

	</tr>
	
	<tr>
		<td colspan="4" class="t_bar">&nbsp;<span class="color_red">*</span>资金来源（金额单位：万元）</td>
	</tr>
	<tr>
		<td nowrap align="right" width="15%">自有资金：</td>
		<td width="35%"><input name="proposal/budget5" type="text" label="资金来源->自有资金" id="budget5"
			class="input_css required" onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			onchange="countFundAuto('budget','5,6,7,8','1');budgetPercent('5,6,7','1');"
			value="<x:out select="$xmlData/data/proposal/budget5" />" />占<input name="proposal/budget5_percent" type="text" id="budget5_percent"
			class="input_css gray" disabled
			onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/proposal/budget5_percent" />" />%</td>
		<td nowrap align="right" width="15%">银行贷款：</td>
		<td width="35%"><input name="proposal/budget6" label="资金来源->银行贷款" type="text" id="budget6"
			class="input_css required" onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			onchange="countFundAuto('budget','5,6,7,8','1');budgetPercent('5,6,7','1');"
			value="<x:out select="$xmlData/data/proposal/budget6" />" />占<input name="proposal/budget6_percent" type="text" id="budget6_percent"
			 class="input_css gray" disabled
			onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/proposal/budget6_percent" />" />%</td>
	</tr>
	<tr>
		<td nowrap align="right" width="15%">政府资助：</td>
		<td width="35%"><input name="proposal/budget7" type="text" label="资金来源->政府资助" id="budget7"
			class="input_css required" onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			onchange="countFundAuto('budget','5,6,7,8','1');budgetPercent('5,6,7','1');"
			value="<x:out select="$xmlData/data/proposal/budget7" />" />占<input name="proposal/budget7_percent" type="text" id="budget7_percent"
			 class="input_css gray" disabled
			onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/proposal/budget7_percent" />" />%</td>
		<td nowrap align="right" width="15%">其他：</td>
		<td width="35%"><input name="proposal/budget8" label="资金来源->其他" type="text" id="budget8"
			class="input_css required" onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			onchange="countFundAuto('budget','5,6,7,8','1');budgetPercent('5,6,7','1');"
			value="<x:out select="$xmlData/data/proposal/budget8" />" /></td>

	</tr>
	<tr>
		<td colspan="4"   class="t_bar">&nbsp;<span class="color_red">*</span>固定资产投资（金额单位：万元）</td>
	<tr>
		<td colspan="2"  align="center" width="50%">&nbsp;设备投资</td>
		<td colspan="2"  align="center" width="50%">&nbsp;土建、公用工程及其他投资</td>
	</tr>
	<tr>
		<td nowrap align="right">计划投资：</td>
		<td width="35%"><input name="proposal/budget9" type="text" id="budget9"
			label="固定资产投资->设备投资->计划投资" class="input_css required"
			onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			onchange="countFundAuto('budget','9,11','3');budgetPercent('9,11','3');"
			value="<x:out select="$xmlData/data/proposal/budget9" />" />占<input name="proposal/budget9_percent" type="text" id="budget9_percent"
			class="input_css gray valueGreatEqual:budget9:budget10" disabled
			onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/proposal/budget9_percent" />" />%</td>
		<td nowrap align="right" width="15%">计划投资：</td>
		<td width="35%"><input name="proposal/budget11" type="text" id="budget11"
			label="固定资产投资->土建、公用工程及其他投资->计划投资" class="input_css required"
			onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right;"
			onchange="countFundAuto('budget','9,11','3');budgetPercent('9,11','3');"
			value="<x:out select="$xmlData/data/proposal/budget11" />" />占
			<input name="proposal/budget11_percent" type="text" id="budget11_percent"
			 class="input_css gray valueGreatEqual:budget11:budget12" disabled
			onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/proposal/budget11_percent" />" />%</td>
	</tr>
	<tr>
	    <td nowrap align="right" width="15%">已完成投资：</td>
		<td width="35%"><input name="proposal/budget10" label="固定资产投资->设备投资->已完成投资" id="budget10"
			type="text" class="input_css required"
			onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			onchange="countFundAuto('budget','9,11','3');budgetPercent('9,11','3');"
			value="<x:out select="$xmlData/data/proposal/budget10" />" /></td>
		
		<td nowrap align="right" width="15%">已完成投资：</td>
		<td width="35%"><input name="proposal/budget12" label="固定资产投资->土建、公用工程及其他投资->已完成投资"
			type="text" class="input_css required" id="budget12"
			onfocus="InitInput.setNumber(this,7,4,2)"
			style="text-align: right; "
			onchange="countFundAuto('budget','9,11','3');budgetPercent('9,11','3');"
			value="<x:out select="$xmlData/data/proposal/budget12" />" /></td>

	</tr>
	<tr>
		<td colspan="8" class="t_bar">&nbsp;<span class="color_red">*</span>项目建成后新增经济效益（金额单位：万元）
		</td>
	</tr>
	<tr>
		<td nowrap align="right" width="15%">销售收入：</td>
		<td width="35%"><input name="proposal/budget13" type="text" label="项目建成后新增经济效益->销售收入"
			class="input_css required" onfocus="InitInput.setNumber(this,7,4,2,this.id,true)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/proposal/budget13" />" /></td>
		<td nowrap align="right" width="15%">利润：</td>
		<td width="35%"><input name="proposal/budget14" label="项目建成后新增经济效益->利润" type="text"
			class="input_css required" onfocus="InitInput.setNumber(this,7,4,2,this.id,true)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/proposal/budget14" />" /></td>
		</tr>
	<tr>
		<td nowrap align="right" width="15%">税金：</td>
		<td width="35%"><input name="proposal/budget15" type="text" label="项目建成后新增经济效益->税金"
			class="input_css required" onfocus="InitInput.setNumber(this,7,4,2,this.id,true)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/proposal/budget15" />" /></td>
		<td nowrap align="right" width="15%">创汇：</td>
		<td width="35%"><input name="proposal/budget16" label="项目建成后新增经济效益->创汇" type="text"
			class="input_css required" onfocus="InitInput.setNumber(this,7,4,2,this.id,true)"
			style="text-align: right; "
			value="<x:out select="$xmlData/data/proposal/budget16" />" />万美元</td>

	</tr>
</table>
<script type="text/javascript">
<!--
$(document).ready(function() {
	productionSituation(document.getElementById("production_situation_vlaue"));
});

function productionSituation(obj) {
	if (obj.value == 1) {
		$("#production_situation_1").show();
		$("#production_situation_2").show();
		$("#production_situation_3").show();
		$("#production_situation_4").show();
		$("#production_situation_5").hide();
		$("#production_situation_6").hide();
		$("#production_situation").show();
		$("#production_situation_plan_date").val("");
		$("#production_situation_end_date").addClass("required");
		$("#production_situation_start_date").addClass("required");
		$("#production_situation_plan_date").removeClass("required");
		$("#production_situation_vlaue").val(obj.value);
		$("#production_situation_name").val("已投产");
	}
	else if (obj.value == 2) {
		$("#production_situation_1").show();
		$("#production_situation_2").show();
		$("#production_situation_3").hide();
		$("#production_situation_4").hide();
		$("#production_situation_5").show();
		$("#production_situation_6").show();
		$("#production_situation").show();
		$("#production_situation_end_date").val("");
		$("#production_situation_start_date").addClass("required");
		$("#production_situation_plan_date").addClass("required");
		$("#production_situation_end_date").removeClass("required");
		$("#production_situation_vlaue").val(obj.value);
		$("#production_situation_name").val("在建 ");
	}else{
		$("#production_situation").hide();
		$("#production_situation_1").hide();
		$("#production_situation_2").hide();
		$("#production_situation_3").hide();
		$("#production_situation_4").hide();
		$("#production_situation_5").hide();
		$("#production_situation_6").hide();
	}
	

}

function  budgetPercent(countStr,totalStr){
	
	var indexs = countStr.split(",");
	var count=$("#budget"+totalStr).val();
	for ( var i = 0; i < indexs.length; i++) {
		var fund = $("#budget"+ indexs[i]).val();
		if(count!=""&&fund!=""&&count!=0){
			var percent=parseFloat(fund)*100/parseFloat(count);
			percent = formatNumber(percent.toString(), 9, 2, 2);// 格式化
			$("#budget"+ indexs[i]+"_percent").val(percent);
			
		}
		else{
			$("#budget"+ indexs[i]+"_percent").val("");	
		}
		
	}


}
//-->
</script>
<script type="text/javascript">
	function selectPsnCall(data) {
	$("input[name$='psn_code']").val(data.person.psnCode);
	$("#basicInfo").find("input[name$='responsible_name']").val(data.person.zhName);
	$("#basicInfo").find("input[name$='responsible_tel']").val(data.personExtend.contact.tel_work);
	$("#basicInfo").find("input[name$='responsible_mobile']").val(data.personExtend.contact.mobile);
	tb_remove2();
	}
	</script>
	<script type="text/javascript">
      $(function() {
         initPersonValue("basicInfo");
      });
      
      function initPersonValue(tblName){
    	  var tbl = $("#" + tblName);
    	 
    	  tbl.find("input[type=hidden]").each(function(){
    			var id=$(this).attr("name");
    			
    			if(id==null || id=="")
    				return true;
    			var parentObj=tbl.find("[name$='/"+id+"']");
    			
    			if(parentObj.val() == null || $.trim(parentObj.val()) == ""){
    				var value= $(this).val();
	    			parentObj.val(value);
    			}
    			
    		});
    	  
      }
</script>

